//
//  DTLetterButton.m
//  DTStandApp
//
//  Created by dt-macmini-ios2 on 15/5/14.
//  Copyright (c) 2015年 dt. All rights reserved.
//

#import "DTLetterButton.h"

@implementation DTLetterButton

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//    NSLog(@"%@",touches);
    UITouch * touch = [touches anyObject];
    double x =[touch locationInView:self.superview].x;
    double y = [touch locationInView:self.superview].y;
    NSDictionary * dic =   @{@"x":[NSNumber numberWithDouble:x],
                             @"y":[NSNumber numberWithDouble:y]};
    
    
    [[NSNotificationCenter defaultCenter]postNotificationName:TOUCH_MOVED_IN_LETTER_BUTTON object:
     dic];
//    NSLog(@"x:%f y:%f",[touch locationInView:self.superview].x,[touch locationInView:self.superview].y);
}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    
//    NSLog(@"%@",touches);
    UITouch * touch = [touches anyObject];
//    NSLog(@"x:%f y:%f",[touch locationInView:self.superview].x,[touch locationInView:self.superview].y);
    
    double x =[touch locationInView:self.superview].x;
    double y = [touch locationInView:self.superview].y;
    
    NSDictionary * dic =   @{@"x":[NSNumber numberWithDouble:x],
                                   @"y":[NSNumber numberWithDouble:y]};

    
    [[NSNotificationCenter defaultCenter]postNotificationName:TOUCH_MOVED_IN_LETTER_BUTTON object:
     dic];

}



@end
